import { ModuleWithProviders, NgModule } from '@angular/core';
import { NgxsModule } from '@ngxs/store';
import { CommonModule } from '@angular/common';
import { TenantComponent } from './tenant/tenant.component';
import { TENANT_MANAGEMENT_ROUTE_PROVIDERS } from './tenant-management.route.provider';
import { TenantManagementRoutingModule } from './tenant-management-routing.module';
import { TenantListState } from './tenant/tenant.states';

import { NzLayoutModule } from 'ng-zorro-antd/layout';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzSpaceModule } from 'ng-zorro-antd/space';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzListModule } from 'ng-zorro-antd/list';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { NzFormModule } from 'ng-zorro-antd/form';
import { NzCardModule } from 'ng-zorro-antd/card';
import { NzCheckboxModule } from 'ng-zorro-antd/checkbox';
import { NzModalModule } from 'ng-zorro-antd/modal';
import { NzMessageModule } from 'ng-zorro-antd/message';
import { NzPaginationModule } from 'ng-zorro-antd/pagination';
import { NzTagModule } from 'ng-zorro-antd/tag';
import { NzDividerModule } from 'ng-zorro-antd/divider';
import { NzDrawerModule } from 'ng-zorro-antd/drawer';
import { NzTabsModule } from 'ng-zorro-antd/tabs';
import { NzAlertModule } from 'ng-zorro-antd/alert';

import { WidgetModule } from '../widget';
import { RefTenantDetailComponent } from './ref-tenant-detail/ref-tenant-detail.component';
import { RefFeatureComponent } from './ref-feature/ref-feature.component';

@NgModule({
  declarations: [TenantComponent, RefTenantDetailComponent, RefFeatureComponent],
  imports: [
    NgxsModule.forFeature([TenantListState]),
    CommonModule,
    TenantManagementRoutingModule,
    NzLayoutModule,
    NzIconModule,
    NzButtonModule,
    NzSpaceModule,
    NzInputModule,
    NzListModule,
    ReactiveFormsModule,
    FormsModule,
    NzFormModule,
    NzCardModule,
    NzModalModule,
    NzMessageModule,
    NzPaginationModule,
    NzTagModule,
    NzDividerModule,
    NzDrawerModule,
    NzTabsModule,
    NzCheckboxModule,
    NzAlertModule,
    WidgetModule,
  ],
})
export class TenantManagementModule {
  static forRoot(): ModuleWithProviders<TenantManagementModule> {
    return {
      ngModule: TenantManagementModule,
      providers: [TENANT_MANAGEMENT_ROUTE_PROVIDERS],
    };
  }
}
